<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="keywords" content="manager" />
	<meta name="description" content="manager" />
	<!-- 网页标签标题 -->
	<title>manager</title>
	<link rel="shortcut icon" href="/img/docsite.ico"/>
	<link rel="stylesheet" href="/build/documentation.css" />
</head>
<body>
	<div id="root"><div class="documentation-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/zh-cn/index.html"><img class="logo" src="/img/txlcn.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">En</span><div class="header-menu"><img class="header-menu-toggle" src="/img/system/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a href="/zh-cn/index.html" target="_self">首页</a></li><li class="menu-item menu-item-normal"><a href="https://bbs.txlcn.org/viewtopic.php?id=42" target="_self">新闻</a></li><li class="menu-item menu-item-normal"><a href="https://bbs.txlcn.org" target="_self">社区</a></li><li class="menu-item menu-item-normal menu-item-normal-active"><a href="/zh-cn/docs/preface.html" target="_self">文档</a></li><li class="menu-item menu-item-normal"><a href="https://github.com/codingapi/tx-lcn/releases" target="_blank">下载</a></li><li class="menu-item menu-item-normal"><a href="/zh-cn/sponsor/index.html" target="_self">赞助</a></li></ul></div></div></header><div class="bar"><div class="bar-body"><img src="/img/system/docs.png" class="front-img"/><span>文档</span><img src="/img/system/docs.png" class="back-img"/></div></div><section class="content-section"><div class="sidemenu"><div class="sidemenu-toggle"><img src="https://img.alicdn.com/tfs/TB1E6apXHGYBuNjy0FoXXciBFXa-200-200.png"/></div><ul><li class="menu-item menu-item-level-1"><span>用户文档</span><ul><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/preface.html" target="_self">入门</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/background.html" target="_self">背景</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/start.html" target="_self">快速开始</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/dependencies.html" target="_self">依赖</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><span>示例<img style="transform:rotate(-90deg)" class="menu-toggle" src="/img/system/arrow_down.png"/></span><ul><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/demo/env.html" target="_self">分布式事务示例</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/demo/dubbo.html" target="_self">TC之Dubbo</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/demo/springcloud.html" target="_self">TC之SpringCloud</a></li></ul></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><span>原理介绍<img style="transform:rotate(-90deg)" class="menu-toggle" src="/img/system/arrow_down.png"/></span><ul><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/principle/control.html" target="_self">控制原理</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/principle/lcn.html" target="_self">LCN模式</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/principle/tcc.html" target="_self">TCC模式</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/principle/txc.html" target="_self">TXC模式</a></li></ul></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><span>配置手册<img style="transform:rotate(-90deg)" class="menu-toggle" src="/img/system/arrow_down.png"/></span><ul><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/setting/client.html" target="_self">TC配置</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/setting/manager.html" target="_self">TM配置</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/setting/distributed.html" target="_self">集群与负载</a></li></ul></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><span>扩展支持<img style="transform:rotate(-90deg)" class="menu-toggle" src="/img/system/arrow_down.png"/></span><ul><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/expansion/transaction.html" target="_self">事务模式扩展</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/expansion/message.html" target="_self">通讯协议扩展</a></li><li class="menu-item menu-item-level-3"><a href="/zh-cn/docs/expansion/rpc.html" target="_self">RPC框架扩展</a></li></ul></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/communication.html" target="_self">通讯指令手册</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/manageradmin.html" target="_self">TM管理手册</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/debug.html" target="_self">问题排查手册</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/test.html" target="_self">性能测试报告</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/developer.html" target="_self">开发者</a></li><li style="height:36px;overflow:hidden" class="menu-item menu-item-level-2"><a href="/zh-cn/docs/fqa.html" target="_self">FQA</a></li></ul></li></ul></div><div class="doc-content markdown-body"><h1>TxManager配置说明</h1>
<h2>application.properties</h2>
<pre><code class="language-properties">
<span class="hljs-meta">spring.application.name</span>=<span class="hljs-string">tx-manager</span>
<span class="hljs-meta">server.port</span>=<span class="hljs-string">7970</span>
<span class="hljs-comment">
#mysql 配置</span>
<span class="hljs-meta">spring.datasource.driver-class-name</span>=<span class="hljs-string">com.mysql.jdbc.Driver</span>
<span class="hljs-meta">spring.datasource.url</span>=<span class="hljs-string">jdbc:mysql://127.0.0.1:3306/tx-manager?characterEncoding=UTF-8</span>
<span class="hljs-meta">spring.datasource.username</span>=<span class="hljs-string">root</span>
<span class="hljs-meta">spring.datasource.password</span>=<span class="hljs-string">root</span>
        
<span class="hljs-meta">mybatis.configuration.map-underscore-to-camel-case</span>=<span class="hljs-string">true</span>
<span class="hljs-meta">mybatis.configuration.use-generated-keys</span>=<span class="hljs-string">true</span>
<span class="hljs-comment">

# TxManager Host Ip 默认为 127.0.0.1</span>
<span class="hljs-meta">tx-lcn.manager.host</span>=<span class="hljs-string">127.0.0.1</span>
<span class="hljs-comment"># TxClient连接请求端口 默认为 8070</span>
<span class="hljs-meta">tx-lcn.manager.port</span>=<span class="hljs-string">8070</span>
<span class="hljs-comment"># 心跳检测时间(ms) 默认为 300000</span>
<span class="hljs-meta">tx-lcn.manager.heart-time</span>=<span class="hljs-string">300000</span>
<span class="hljs-comment"># 分布式事务执行总时间(ms) 默认为36000</span>
<span class="hljs-meta">tx-lcn.manager.dtx-time</span>=<span class="hljs-string">36000</span>
<span class="hljs-comment">#参数延迟删除时间单位ms  默认为dtx-time值</span>
<span class="hljs-meta">tx-lcn.message.netty.attr-delay-time</span>=<span class="hljs-string">36000</span>
<span class="hljs-comment">#事务处理并发等级 默认为128</span>
<span class="hljs-meta">tx-lcn.manager.concurrent-level</span>=<span class="hljs-string">128</span>
<span class="hljs-comment">
#后台登陆密码，默认值为codingapi</span>
<span class="hljs-meta">tx-lcn.manager.admin-key</span>=<span class="hljs-string">codingapi</span>
<span class="hljs-comment">#分布式事务锁超时时间 默认为-1，当-1时会用tx-lcn.manager.dtx-time的时间</span>
<span class="hljs-meta">tx-lcn.manager.dtx-lock-time</span>=<span class="hljs-string">-1</span>
<span class="hljs-comment">#雪花算法的sequence位长度，默认为12位.</span>
<span class="hljs-meta">tx-lcn.manager.seq-len</span>=<span class="hljs-string">12</span>
<span class="hljs-comment">#异常回调开关</span>
<span class="hljs-meta">tx-lcn.manager.ex-url-enabled</span>=<span class="hljs-string">false</span>
<span class="hljs-comment"># 事务异常通知（任何http协议地址。未指定协议时，为TxManager提供的接口）</span>
<span class="hljs-meta">tx-lcn.manager.ex-url</span>=<span class="hljs-string">/provider/email-to/***@**.com</span>
<span class="hljs-comment">


# 开启日志,默认为false</span>
<span class="hljs-meta">tx-lcn.logger.enabled</span>=<span class="hljs-string">true</span>
<span class="hljs-meta">logging.level.com.codingapi</span>=<span class="hljs-string">debug</span>
<span class="hljs-comment">#redis 的设置信息</span>
<span class="hljs-meta">spring.redis.host</span>=<span class="hljs-string">127.0.0.1</span>
<span class="hljs-meta">spring.redis.port</span>=<span class="hljs-string">6379</span>
<span class="hljs-meta">spring.redis.password</span>=<span class="hljs-string"></span>


</code></pre>
<hr>
<p><code>注意（NOTE）</code></p>
<p>(1) TxManager所有配置均有默认配置，请按需覆盖默认配置。</p>
<p>(2) <em>特别注意</em> TxManager进程会监听两个端口号，一个为<code>TxManager端口</code>，另一个是<code>事务消息端口</code>。TxClient默认连接<code>事务消息端口</code>是<code>8070</code>，
所以，为保证TX-LCN基于默认配置运行良好，请设置<code>TxManager端口</code>号为<code>8069</code> 或者指定<code>事务消息端口</code>为<code>8070</code></p>
<p>(3) <code>分布式事务执行总时间 a</code> 与 <code>TxClient通讯最大等待时间 b</code>、<code>TxManager通讯最大等待时间 c</code>、<code>微服务间通讯时间 d</code>、<code>微服务调用链长度 e</code> 几个时间存在着依赖关系。
<code>a &gt;= 2c + (b + c + d) * (e - 1)</code>, 特别地，b、c、d 一致时，<code>a &gt;= (3e-1)b</code>。你也可以在此理论上适当在减小a的值，发生异常时能更快得到自动补偿，即 <code>a &gt;= (3e-1)b - Δ</code>（<a href="../fqa.html">原因</a>）。
最后，调用链小于等于3时，将基于默认配置运行良好</p>
<p>(4) 若用<code>tx-lcn.manager.ex-url=/provider/email-to/xxx@xx.xxx</code> 这个配置，配置管理员邮箱信息(如QQ邮箱)：</p>
<pre><code class="language-properties"><span class="hljs-meta">spring.mail.host</span>=<span class="hljs-string">smtp.qq.com</span>
<span class="hljs-meta">spring.mail.port</span>=<span class="hljs-string">587</span>
<span class="hljs-meta">spring.mail.username</span>=<span class="hljs-string">xxxxx@**.com</span>
<span class="hljs-meta">spring.mail.password</span>=<span class="hljs-string">*********</span>
</code></pre>
<hr>
</div></section><footer class="footer-container"><div class="footer-body"><img src="/img/txlcn.png"/><div class="cols-container"><div class="col col-12"><h3>愿景</h3><p>我们将致力于打造一个快捷、高效、兼任性强的分布式事务解决方案</p></div><div class="col col-6"><dl><dt>导航</dt><dd><a href="/zh-cn/docs/txlcn-arch.html" target="_self">TX-LCN解决方案</a></dd><dd><a href="/zh-cn/docs/start.html" target="_self">快速上手</a></dd><dd><a href="/zh-cn/docs/txlcn-mod.html" target="_self">开发计划</a></dd><dd><a href="https://bbs.txlcn.org/viewforum.php?id=8" target="_self">报告Bug</a></dd></dl></div><div class="col col-6"><dl><dt>友情链接</dt><dd><a href="https://www.codingapi.com/" target="_blank">CodingApi</a></dd></dl></div></div><div class="copyright"><span>Copyright © 2018-2019 CodingApi</span></div></div></footer></div></div>
	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
	<script>
		window.rootPath = '';
  </script>
	<script src="/build/documentation.js"></script>
</body>
</html>